Media stream monitor with heartbeat timer

ABSTRACT

A stream monitor can request a streaming media server to send stream records associated with streams currently being served. The stream monitor uses the stream records to test streams being served by the streaming media server. The stream monitor can concurrently test multiple streams for connection errors, silence errors, metadata errors, and other errors. The stream monitor initiates a data stream monitoring application, initiates a heartbeat timer to produce a periodic heartbeat signal and delivers, to a host webpage, a last data stream record to be tested in conjunction with the heartbeat signal. When a periodic heartbeat signal is not received in a timely manner the monitor restarts the stream testing application at the last data record tested.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present U.S. Utility patent application claims priority pursuant to35 U.S.C. § 120 as a continuation of U.S. Utility application Ser. No.16/196,627 entitled “Media Stream Monitor,” filed Nov. 20, 2018,scheduled to issue as U.S. Pat. No. 10,771,362 on Sep. 8, 2020, which isa continuation of U.S. Utility application Ser. No. 15/218,113 entitled“Media Stream Monitor,” filed Jul. 25, 2016, now U.S. Pat. No.10,171,324 issued on Jan. 1, 2019, which is a continuation of U.S.Utility application Ser. No. 12/648,806 entitled “Media Stream Monitor,”filed Dec. 29, 2009, now U.S. Pat. No. 9,401,813 issued on Jul. 26,2016, all of which are hereby incorporated herein by reference in theirentirety and made part of the present U.S. Utility patent applicationfor all purposes.

FIELD

The present disclosure relates generally to streaming media, and moreparticularly to monitoring media streams for errors.

BACKGROUND

There are currently a number of different technologies available formonitoring media streams. One type of stream monitoring involves usersphysically observing a media stream using a streaming playerapplication. The observers may be Customer Service users, in which casethey can report problems to a service department, but problemidentification based on observation can be sporadic and unreliable. Insome cases, the observers may be trained Quality Assurance personnel,which can improve the reliability of the monitoring, but it can still bedifficult to pinpoint the source of identified problems.

A second type of stream monitoring is referred to as Single StreamMonitoring. In Single Stream Monitoring, a single application isdedicated to monitoring a single stream resource. All informationrequired to connect to the stream is generally hard-coded into theapplication. Client-side monitoring, which involves a monitoring modulebuilt into an end-user client application, is a third option.

Each of these technologies provides limited stream monitoringcapabilities. Some are limited to monitoring a small subset of availablestreaming protocols and formats, while others may not provide theability to monitor all important aspects of a stream. It is apparent,therefore, that currently available stream monitoring technologies areless than perfect.

SUMMARY

A method according to various embodiments includes receiving a multiplestream records associated with media streams being served by a streamserver, concurrently testing multiple streams of the first plurality ofmedia streams for streaming errors, and reporting a result of thetesting for each of the first plurality of media streams. In someembodiments this and other methods can be implemented by executing aprogram instruction in a computer system.

Testing of individual media streams can be discontinued in responseeither an error associated with the media stream being detected, or itmay continue until the media stream connects and broadcasts metadata. Insome embodiments, in response to testing of the media streams beingcompleted, stream records are removed from memory, and a second batch ofstream records associated with other media streams being served by thestream server are received for testing.

Some methods include attempting to establish concurrent connections tomultiple media streams, based on information included in stream records.Testing the media streams can include generating programming eventsindicating a status of each of the individual media streams, andproviding those programming events to one or more program eventhandlers.

A system according to some embodiments includes a processor, memoryoperably associated with the processor, and a program of instructionsconfigured to be stored in the memory and executed by the processor. Theprogram of instructions can include instructions configured to implementvarious stream monitoring processes and methods described herein.Various embodiments can take the form of a computer readable mediumtangibly embodying a program of computer executable instructions.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects of this disclosure will become apparent upon reading thefollowing detailed description and upon reference to the accompanyingdrawings, in which like references may indicate similar elements:

FIG. 1 is a block diagram illustrating a broadcasting system including astream monitor according to various embodiments of the presentdisclosure;

FIG. 2 is a block diagram illustrating a broadcast chain including astream monitor according to various embodiments of the presentdisclosure;

FIG. 3 is a flow chart illustrating a method according to variousembodiments of the present disclosure; and

FIG. 4 is a high level block diagram of a processing system according toembodiments of the present disclosure.

DETAILED DESCRIPTION

The following is a description of embodiments of the disclosure depictedin the accompanying drawings. The embodiments are presented insufficient detail to clearly communicate the disclosure to one ofordinary skill in the art. However, the amount of detail offered is notintended to limit the anticipated variations of embodiments; on thecontrary, the intention is to cover all modifications, equivalents, andalternatives falling within the spirit and scope of the presentdisclosure as defined by the appended claims.

It is often desirable to monitor broadcast content at various points andtimes to ensure that the intended broadcast content is being properlytransmitted to audience. It is usually readily apparent to many peopleif there are problems with an On-Air broadcast, but the same is notnecessarily true of streaming broadcasts, because each individualbroadcast stream is often observed by significantly fewer audiencemembers.

Referring to FIG. 1, a system 100 configured to provide monitoring ofindividual broadcast streams according to various embodiments of thepresent disclosure will be discussed. System 100 includes mediaautomation system 110, which can be used to control and automate variousmedia broadcast functions; and traffic and billing system 120, which isused to provide control for various traffic and billing functions suchas entering and editing orders, and scheduling spots. System 100 alsoincludes streaming broadcast chain 160, through which a streamingbroadcast of media content can be provided to a network such as Internet161; on air broadcast chain 150, through which media content can bebroadcast via a broadcast tower 151 or otherwise; and various mediasources such as an individual source media 142, bulk media storage 141,programming from another market received via network 140, andprogramming broadcast via satellite 131 received via satellite receiver130. System 100 also includes stream monitor 162, which can be used tomonitor streams generated by streaming broadcast chain 160 for deliveryto end users via Internet 161 or otherwise.

Stream monitor 162 can be used in various embodiments to test multiplestreams generated by streaming broadcast chain 160 asynchronously andconcurrently—and does not require testing media streams one at a time,and in sequence. Various embodiments of stream monitor 162 can be usedto provide more nearly real time monitoring and reporting of mediastream errors, and can be used to provide a visual display of themonitored metrics. In addition, various embodiments of stream monitor162 do not require separate instances of a monitoring software module tomonitor each individual stream. Instead, some embodiments permitmultiple streams to be monitored concurrently using only a singleinstance of a stream monitor software module.

Furthermore, various embodiments of stream monitor 162 allow dynamicconfiguration of monitoring parameters, and monitoring a stream only aslong as necessary, for example until errors are found, or until amonitored stream is confirmed to be successfully connected withoutsilence or metadata errors.

Referring next to FIG. 2, a broadcast chain 200 including a streammonitor 280 will be discussed according to various embodiments of thepresent disclosure. Broadcast chain 200 includes media processing server210, which generates a primary stream of content for broadcast anddelivers the primary stream to encoding unit 220, where the stream canbe encoded into any of various streaming formats for delivery tostreaming server 230. Broadcast chain 200 also includes streaming server230, which receives the encoded stream and provides multiple individualstreams, for example media streams 232, 234, and 236, to variousrequestors. In at least one embodiment, media streams 232 and 234 aredelivered to different end users via network 240, and media stream 236is delivered to media provider 250, which may rebroadcast all or aportion of the media content included in media stream 236.

As is well known by those of skill in the art of streaming media,multiple end users or other entities can request to connect to streamingserver 230. Once a connection is established, streaming server 230 cantransmit packetized media content in individual media streams to each ofthe requestors over separate network connections. Streaming mediaplayers, for example streaming video or audio players, receive, decode,and play the media content at the requestors' locations.

The media streams 232, 234, and 236 which are streamed to the requestorsmay include both media content and metadata associated with the mediacontent of the media streams. For example, each media stream may includea song or other audio content, while the metadata includes variousinformation about the song such as a title, author, artist performingthe song, related concert events, or other desired information. Themetadata can be used to generate displays or perform other functions ona computer running the streaming media player.

Broadcast chain 200 also includes stream monitor 280, which can includeget stream module 282 for requesting stream records from streamingserver 230; graphical user interface (GUI) host 285, for hosting GUImodule 287; GUI module 287, for generating and preparing displaysrelated to the status of the streams in the system currently beingmonitored; display 270, for displaying a GUI generated by GUI module287; stream monitor host 284, to host stream monitor module 286; andstream monitor module 286, for performing event driven monitoring ofmedia streams associated with stream records obtained by get streammodule 282.

Get streams module 282 can be configured to communicate with streamingserver 230 to request stream records associated with each of the mediastreams 232, 234, and 236. When the stream records are received, streammonitor module 286 can individually and concurrently monitor each of themedia streams 232, 234, and 236 for connection errors, media contenterrors, metadata errors, or other errors related to a media stream beingserved by streaming server 230. In some embodiments, once all mediastreams have completed their individual tests, the streams aredisconnected, and additional stream records are requested.

Stream monitor module 286 can deliver testing results to a displaydevice, such as display 270, via GUI 287. Additionally or alternatively,stream monitor module 286 can deliver the results for storage inmemcache servers (not illustrated), database 260, or elsewhere. Invarious embodiments, stream monitor module 286 can provide error orsuccess notifications on a stream by stream basis, immediately uponcompletion of testing for an individual stream. In other embodiments,testing results are reported after testing of an entire batch of streamsindicated in the streaming records received from streaming server 230.

Successful streams can be reported in an asynchronous Hypertext TransferProtocol (HTTP) request, in response to which previous errors reportedby a successful stream can removed from the database, memcache servers,or elsewhere. In some embodiments, all stream records received by getstream module 282 are also removed from system memory upon completion oftesting all media streams associated with received stream records. A newset of streams beginning at the last stream record received and endingat a configurable amount of stream records to be monitored concurrentlycan be asynchronously requested from the same streaming server 230, andthe process can repeat itself until the stream monitor application isshut down.

In some embodiments, get stream module 282 can request a designatednumber of stream records based on a number of individual streams thatstream monitor module 286 can test at any one time. In variousembodiments, the number of streams requested is configurable by a user,and may be based on anticipated system loads and resources. In someembodiments, a beginning or ending stream record can also be set.

In the illustrated embodiment, stream monitor 280 is shown as astandalone computing device running various event-driven softwaremodules, e.g. get streams module 282, graphical user interface (GUI)host 285, GUI module 287, stream monitor host 284, and stream monitormodule 286. Stream monitor 280 can, in some cases, be implemented inanother device, for example media processing server 210 or streamingserver 230. In some embodiments, stream monitor 280 may be a softwareprogram, or can include some combination of software, firmware, orhardware. In at least one embodiment, a stream monitor 280 can beimplemented as a set of web pages serving specifically formattedextensible markup language (XML) pages, whether generated via a dynamicscripting language, or created by hand and served via proxy through adynamic scripting language (the query parameters should be parsed to getthe correct records back).

Referring next to FIG. 3, a method 300 of concurrently monitoringmultiple media streams will be discussed according to variousembodiments. Method 300 begins at block 305. As illustrated by block307, a number of media streams to concurrently monitor for errors can beset. The number of streams to be concurrently processed can be setautomatically or manually, based on system resources, or as otherwisedesired.

As illustrated by block 309, a media stream monitoring program can senda request to a streaming server for stream records. In some embodiments,the media stream monitoring program can be implemented as a webpage thatrequests stream records from a stream manager database, and builds theXML return. The stream records for each media stream can include, butare not limited to, the following: the protocol to use to connect to thestream; the URL used to connect to the stream; the path on the streamingserver to the stream; the host name of the host hosting this stream onthe streaming server; the stream title for this stream; the sitedassociated with this stream; the station associated with the stream;description—the stream type description of the stream; the type of URLfor this stream; the unique id number for the stream; a secured hashtoken used to connect to the stream; and the total number of streamrecords available in the system.

In some embodiments, the request can be used to pass an integer valuestartAt, which indicates the stream record number at which to beginretrieving stream records, and an integer value limit, which is thetotal number of records to retrieve and can correspond to the number ofstreams set at block 307.

As illustrated by block 311, the stream monitor attempts to establishconnections with the media streams referenced in the stream records.Connection attempts to multiple media streams can be made usinginformation included in the stream records. In at least one embodiment,connecting to a stream records means that packets included in a streambeing served to an end user are sampled, read, intercepted, or otherwiseaccessed.

As illustrated by block 313, a check can be made to determine if one ormore of the streams did not connect. In addition to testing forconnection errors, media streams can also be checked for silence oramplitude errors, metadata errors, and other types of errors. Asillustrated by block 315, if no errors are detected for a particularmedia stream, method 300 checks to determine if the stream successfullyconnects and begins to send metadata. If the media stream beingmonitored has not yet successfully connected and streamed metadata,method 300 continues to check for errors as illustrated by block 313.

As illustrated by block 317, testing of each individual media streamcontinues until either an error occurs, or the media stream connects andstreams metadata, at which point testing of the stream is discontinued,and the results are reported. In some embodiments, errors may not bereported until all of the media streams being concurrently testedexperience an error or connect and successfully send metadata.

As illustrated by block 319, when testing of a particular media streamhas completed, a check can be made to determine if testing is completefor all, or a designated number, of media streams being concurrentlytested. If all streams are not done testing, the testing of theremaining streams can continue.

If there are large numbers of total streams to be monitored keepingtrack of the last tested record is advantageous. Thus, in at least someembodiments, a configurable lastRecord integer is used in the event of afailure to notify a stream monitor of a starting stream. The lastRecordinteger also allows a stream monitor to chunk large numbers of streamsinto a single testing round or batch.

The lastRecord integer can be delivered in conjunction with a“heartbeat” signal, which is used to send a JavaScript message to ahosting web page of the application periodically. The hosting web page,for example, may expect a heartbeat signal every second, and if onedoesn't come, the lastRecord integer can be used to re start the streammonitoring application from where it left off. Some embodiments do notuse a heartbeat signal. For example, various desktop implementations canwrite a limit and last record to a file, which can be copied and checkedperiodically to ensure that the value is still changing.

In some embodiments, the lastRecord can also be used to keep track ofwhere the application is at in relation to the total number of streamsthe application is monitoring. So, for example, once the total streamstested is equal to the total number of streams to test, the applicationresets lastRecord to zero and begins to test all the streams again.

As illustrated by block 321, if testing has been completed for all ofthe media streams being concurrently tested, the stream records can beremoved from memory, and a new request for stream records can be sent asillustrated by block 309.

In various embodiments, method 300 is implemented using an event-drivenarchitecture. Events are specific moments in application execution thatare subscribed/listened to by zero or more objects, triggering thoseobjects to execute some action. Using an event-driven architectureallows various methods to be private, internal, or protected members ofa listener object. Additionally, event handlers can be polymorphic, andoverridden or inherited by child classes.

A potential advantage of using an event-based architecture fordetermining whether or not stream errors have occurred is that severallistener objects can respond to the same event at roughly the same timewithout interfering with each other, thereby allowing a synchronousprogram to run asynchronously. Furthermore, code maintenance can besimplified. Events can be broadcast without consideration of whethercallbacks are subscribed or exist. Different classes can listen to thesame event and behave in different ways than other event handlers, anddispatch event need not be deleted in the dispatching object, becauseactions are only executed if anything is listening to the event.

Some events that can be generated by a stream monitor application tofacilitate testing for stream errors include the following:

-   -   mx.events.FlexEvent.CREATION_COMPLETE-triggers application        script execution after the application is finished building.    -   com.cc.BaseViewEvent.DATA_READY-triggers application actions        that are dependent upon the view elements being created. In this        case, begins testing execution in the        TestStreamMetadataController object.    -   TestStreamMetadataController._pingTimer-TimerEvent.TIMER_COMPLETE        event:    -   triggers the sending of a “heartbeat” to the application host        container, indicating that the flash VM is still running.    -   TestStreamMetadataController._streamApi-StreamApiEvent.STREAM_DO_CREATED        event: triggered when a xml entity retrieved from the webserver        has been converted into a StreamDo data object. The data object        is sent as a property of the event object.    -   mx.rpc.events.ResultEvent.RESULT event: data from the http        request has been received. Triggers the        StreamApi.resultEventHandler in this application.    -   com.ak.events.AkErrorEvent.ERROR event: there has been an error        on the stream associated with the event target. Depending on the        errors error number, a stream connection error may be posted.    -   com.ak.events.AkStatusEvent.NETSTREAM_METADATA event: a stream        has metadata to report via the connection.        The com.cc.controller.TestStreamMetadata.metadataHandler method        listens for this event and uses the information passed in it to        determine if the metadata is valid. Failure to send this event        or invalid or empty fields within this event can cause a        metadata error to be reported.    -   com.ak.events.AkStatusEvent.“onUDPData” event: A non-orban card        encoded stream has metadata to report via the connection.        The com.cc.controller.TestStreamMetadata.metadataHandler method        listens for this event and uses the information passed in it to        determine if the metadata is valid. Failure to send this event        or invalid or empty fields within this event on non-orban card        encoded streams causes a metadata error to be reported.    -   Com.ak.events.AkNotificationEvent.CONNECTED event: indicates        that the stream has connected to the host and can attempt to        play the file requested.    -   Com.ak.events.AkStatusEvent.NETSTREAM event: indicates a change        in the connection associated with a streamDo has changed status.        Netstream events with “Netstream.Play.Start” info.code        properties indicate a true successful connection to a stream and        trigger the streamDo.connected property to be set to true. Other        status messages can be ignored or cause a stream connection        error to be reported.    -   Com.ak.events.AkStatusEvent.NETSTREAM_PLAYSTATUS: indicates that        a stream on a connection associated with a particular streamDo        has completed or changed to a different stream. Since the radio        streams can be set to run all the time, this may indicate a        connection error.    -   Com.cc.events.api.StreamApiEvent.REQUEST_RECEIVED: indicates        that a request sent by the StreamApi has received a response.    -   Com.cc.events.api.StreamApiEvent.FAULT: indicates that the        StreamApi request has failed.    -   Com.cc.events.api.StreamApiEvent.STREAM_DO_CREATED: indicates        that a StreamDo object has been created from the StreamApi        request result.

An event-driven architecture also includes event handlers, which respondto events. A single event can trigger several event handlers. An eventhandler typically accepts a single event class type, or children of anevent type. It is possible to assign an event handler for every eventtype of a given event class, but typically a separate event handler isassigned for each event type in an event class. A stream monitorapplication according to some embodiments follows this practice. Thefollowing is a list of some event handlers, with the event classes andtypes that they accept:

-   -   com.cc.api.StreamApi.resultEventHandler-mx.rpc.events.ResultEvent.RESULT:        handles the result of the server request, in this case        converting each xml entity stream record into a        com.cc.dO.StreamDo object, firing a        com.cc.events.api.StreamApiEvent.STREAM_DO_CREATED event        containing the created StreamDo object, initiating testing of        the streams.    -   Com.cc.controller.TestStreamMetadataController.streamApiDoCreatedHandler-com.cc.events.api.StreamApiEvent.STREAM_DO_CREATED:        handles the event that is fired when a StreamDo is created from        a StreamApi request. Sets up the streamDo's connection, the        connection's event handlers, the streamDo's test timer, and the        testing variables, initializing the test by calling the        connection's connect method.    -   Com.cc.controller.TestStreamMetadataController.connectedHandler-com.ak.events.AkNotificationEvent.CONNECTED:        begins playback of the streamDo's stream.    -   Com.cc.controller.TestStreamMetadataController.errorHandler-com.ak.events.AkErrorEvent.ERROR:        Handles any error event broadcast by the connection. Nearly        every error event triggers a connection error to be posted.    -   Com.cc.controller.TestStreamMetadataController.streamPlayStatusHandler-com.ak.events.AkStatusEvent.NETSTREAM_PLAYSTATUS:        handles stream events related to the play status, including the        original NetStream.Play code indicating that the streamDo's        connection has successfully connected to the stream.    -   Com.cc.controller.TestStreamMetadataController.metadataHandler-com.ak.events.AkStatusEvent.NETSTREAM_METADATA:        Handles any metadata events issued by streams that are ORBAN        sound card encoded. Checks to see that all the information        required exists in the metadata event issued by the streamDo's        connection. If the information doesn't exist, issues a metadata        error report to the server. If the encoding information is an        ORBAN encoded stream, completes the test for the streamDo        instance by calling testComplete.    -   Com.cc.controller.TestStreamMetadataController.udpHandler-com.ak.events.AkStatusEvent.onUDPData:        similar to the Metadata handler, handles metadata from        streamDos' connections when the stream is NOT encoded by an        ORBAN sound card. When this is triggered, the test is completed.        In some embodiments, this handler will issue an error report if        metadata criteria are not fulfilled.

The monitor application's com.cc.api.StreamApi.getFlashStreamsByLimitmethod accepts the lastRecord and the total number of streams to fetchat one time. As the monitor application cycles through each round,eventually there will be a small number of streams left. The applicationthen only requests the remaining number of streams to keep from doublytesting streams when the application starts over from record 0.

A particular embodiment of method 300 begins with a host web pageinitializing a stream monitoring application. Once all the componentsare loaded and rendered, a creationComplete event triggers theinstantiation of a com.cc.view.TestStreamMetadataView, passing theapplication as a parameter.

The view creates a com.cc.controller.TestStreamMetadataControllerinstance, adds listeners for the controller's clearText, error, and infoevents, then dispatches a dataReady event, indicating that it is readyto display data.

When the controller is instantiated, it stores a reference to the view.Then it stores the lastRecord parameter passed to the application. Itregisters baseViewEventDataReady as the event handler for the view'sdataReady event, initializes the application heartbeat pingTimer timer,and adds listeners for its TimerEvent.TIMER event to send a JavaScriptnotification to the hosting web page. Then it starts the _pingTimer.

The _pingTimer fires every second, sending _lastRecord to the hostingweb page. If the application fails, the _pingTimer heartbeat won't fire,and the application will be restarted by the host web page.

After the view dispatches its dataReady event, the event is caught bythe controller's baseViewEventDataReady handler. The controller'stestStreams and totalTestStreams are set to zero. The StreamApi instanceis instantiated, and streamApiDoCreatedHandler is registered to listenfor the com.cc.events.api.StreamApiEvent.STREAM_DO_CREATED event, whichwill happen once for every record received. Then the StreamApi'sgetFlashStreamsByLimit method is called, initializing testing.

The getFlashStreamsByLimit disconnects the _flashStreamingServicemx.rpc.http.HTTPService instance, clears any previous result, sets theservice's URL property to the xml location, sets the service'sresultFormat to e4x, sets the param object's startAt to the lastparameter and sets params object's limit property to the limit parameterpassed when the getFlashStreamsByLimit method was called. The previousevent listeners are then removed from the service, and re-added. Thisreduces memory leak potential. Then the request is sent to the service'sURL, passing the params object as GET variable name value pairs.

If the service fails, a mx.rpc.http.HTTPService.fault event isdispatched and caught by the StreamApi's faultEventHandler method. Theservice's faulEventHandler is removed so that it doesn't fire twice, andthe StreamApi dispatches an event notifying of the failure.

If the service is successful, a mx.rpc.http.HTTPService.result event isdispatched and caught by the StreamApi's resultEventHandler method. Thismethod increases the StreamApi::_requestNumber property by 1, removesthe result event listener to prevent it from firing twice, converts theresult string to an XML document and stores it in a local methodvariable. The number of records returned in the request is the number ofchildren of the XML document. If there are multiple records, thechildren are looped through, and each record's properties are stored ona new StreamDo object and dispatched with aStreamApi.StreamApistreamDoCreated event. If there is only one record,that record is converted to a stream Do object and dispatched with aStreamApi.StreamApistreamDoCreated event. If the result contains norecords, the total amount of streams has been exceeded by the limit andstartAt parameters passed to StreamApi::getStreamsByLimit, so thegetStreamsByLimit is called again with 0 as startAt and 50 as limit tostart the next testing round, thus making the algorithm self-sustaining.

When each STREAM_DO_CREATED event is dispatched, it is caught by thecontroller's streamApiDoCreatedHandler. After the connection is created,the stream monitor creates a metadata timeout timer. This timer is themaster timeout, killing the test and logging the appropriate error aftera period of 35000 milliseconds if the stream hasn't connected orreceived metadata. The controller's_recordsExpected is set to theevent's streamDo.streamsExpected property minus 1. The controller's_streamsToTest is set to the event's streamDo.testStreams property. Thecontroller's _lastRecord is incremented by 1. The metadata timer isadded to the streamDo, and an event listener for the timer's timercomplete event is added to the timer. TestComplete, connected, andmetadataSuccess are set to false and added to the streamDo. The Akconnection is added to the streamDo. Event listeners for the abovelisted interesting com.ak.events events are added to the connection, andthe connection's maxBufferLength is set to 5 seconds, and itsliveStreamMasterTimeout to 15 seconds. The buffer length can be used tolimit the amount of memory a stream is allowed to use, and the mastertimeout can be used to prevent a stream from trying to connect forever.If a stream takes longer than 15 seconds to connect, the connection isassumed to have failed. The metadataTimer is started and theconnection's connect method is called.

If the connect method works, the connection dispatches a connectedevent. This does not necessarily mean that the stream itself will playor is truly connected. It means that the hosting application on theflash media server was found. The streamDo containing the connection isnot set connected to true until a NETSTREAM_PLAYSTAUS event withNetstream.Play.Start info code is dispatched by the connection.

Any errors dispatched by the connection are handled by the controller'serrorHandler. If it is an error related to the connection, a connectionerror is reported via the StreamPostApi's sendConnectionError method.

The connection test for a single stream can be considered to be completewhen NETSTREAM_PLAYSTATUS event with an info.code property ofNetStream.Play.Start occurs.

The metadata test (for a single stream) can be considered to be completewhen a NETSTREAM_METADATA or a onUDPData event is dispatched with allthe required information in the metadata object. If the information isinvalid, a metadata error is reported by StreamPostApi viasendMetadataError. If the metadata is valid, the streamDo'smetadataSuccess variable is set to true, testComplete is called,stopping the streamDo's metadata timer, incrementing the number of testscomplete, removing event listeners from the streamDo, and checking tosee if all the tests for this round have completed usingtestingRoundComplete.

If the metadata timer for a streamDo completes and connected is true, ametadata error is posted and testComplete is called.

TestingRoundComplete checks to see if testStreams is greater than orequal to _recordsExpected. If it is, the round of testing is completedand the streams are looped through. Each stream that connected and hadmetadata is sent to the server (in a comma separated string), identifiedby streamId number. Each stream is stripped of event listeners. Eachstream's connection is closed and unsubscribed, and the metadata timersreset. A wait of ten seconds is started to give the garbage collectortime to clean up, then finshRound is called.

In finishRound, the controller is reset to receive the next round ofstream records. All the old streams are cleared out and replaced by ablank_streams array. _successStreamIds is also cleared and reset. If_totalTestsComplete is greater than or equal _streamsToTest minus 1, allthe streams have been tested and the monitor should start over at stream0, so lastRecord and _totalTestsComplete are set to 0. Otherwise, theyremain as they were. Then the monitor waits for 20 seconds to allow thegarbage collector to do its job, then getNextStreams is called, firing anew request for stream records by StreamApi and starting the next roundof testing.

Referring next to FIG. 4, a high-level block diagram of a processingsystem is illustrated and discussed. Processing system 400 includes oneor more central processing units, such as CPU A 405 and CPU B 407, whichmay be conventional microprocessors interconnected with various otherunits via at least one system bus 410. CPU A 405 and CPU B 407 may beseparate cores of an individual, multi-core processor, or individualprocessors connected via a specialized bus 411. In some embodiments, CPUA 405 or CPU B 407 may be a specialized processor, such as a graphicsprocessor, other co-processor, or the like.

Processing system 400 includes random access memory (RAM) 420; read-onlymemory (ROM) 415, wherein the ROM 415 could also be erasableprogrammable read-only memory (EPROM) or electrically erasableprogrammable read-only memory (EEPROM); and input/output (I/O) adapter425, for connecting peripheral devices such as disk units 430, opticaldrive 436, or tape drive 437 to system bus 410; a user interface adapter440 for connecting keyboard 445, mouse 450, speaker 455, microphone 460,or other user interface devices to system bus 410; communicationsadapter 465 for connecting processing system 400 to an informationnetwork such as the Internet or any of various local area networks, widearea networks, telephone networks, or the like; and display adapter 470for connecting system bus 410 to a display device such as monitor 475.Mouse 450 has a series of buttons 480, 485 and may be used to control acursor shown on monitor 475.

It will be understood that processing system 400 may include othersuitable data processing systems without departing from the scope of thepresent disclosure. For example, processing system 400 may include bulkstorage and cache memories, which provide temporary storage of at leastsome program code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Various disclosed embodiments can be implemented in hardware, software,or a combination containing both hardware and software elements. In oneor more embodiments, the invention is implemented in software, whichincludes but is not limited to firmware, resident software, microcode,etc. Some embodiments may be realized as a computer program product, andmay be implemented as a computer-usable or computer-readable mediumembodying program code for use by, or in connection with, a computer, aprocessor, or other suitable instruction execution system.

For the purposes of this description, a computer-usable or computerreadable medium can be any apparatus that can contain, store,communicate, or transport the program for use by or in connection withan instruction execution system, apparatus, or device. By way ofexample, and not limitation, computer readable media may comprise any ofvarious types of computer storage media, including volatile andnon-volatile, removable and non-removable media implemented in anysuitable method or technology for storage of information such ascomputer readable instructions, data structures, program modules, orother data. Computer storage media include, but are not limited to, RAM,ROM, EEPROM, flash memory or other memory technology, CD-ROM, digitalversatile disks (DVD) or other optical storage, magnetic cassettes,magnetic tape, magnetic disk storage or other magnetic storage devices,or any other medium which can be used to store the desired informationand which can be accessed by a computer.

Various embodiments have been described for a media stream monitor.Other variations and modifications of the embodiments disclosed may bemade based on the description provided, without departing from the scopeof the invention as set forth in the following claims.

What is claimed is:
 1. A method for data stream monitoring, the methodcomprises: initiating a data stream monitoring application; initiating aheartbeat timer to produce a periodic heartbeat signal; delivering, to ahost webpage, a last data stream record to be tested in conjunction withthe periodic heartbeat signal; detecting that the periodic heartbeatsignal was not received with the last data stream record; andrestarting, based on the detecting, the data stream monitoringapplication at the last data record tested.
 2. The method of claim 1,wherein the initiating a heartbeat timer to produce a periodic heartbeatsignal triggers delivering of the periodic heartbeat signal to anapplication host container of the data stream monitoring application. 3.The method of claim 2, wherein the delivering of the periodic heartbeatsignal to the application host container indicates that flash virtualmemory (VM) is still running.
 4. The method of claim 1 wherein thedelivering, to a host webpage, a last data stream record to be tested inconjunction with the periodic heartbeat signal includes delivering aJavaScript message to the host webpage.
 5. The method of claim 1 furthercomprises creating a test stream metadata controller instance includesadding listeners for a controller's clear text, error, or info events.6. The method of claim 1, further comprises dispatching a data readyevent, indicating that it is ready to display data.
 7. The method ofclaim 1 wherein the heartbeat timer is a ping-timer.
 8. The method ofclaim 1 further comprises listening for a stream event once for everystream record received.
 9. A stream monitoring method, the methodcomprises: a host web page initializing a stream monitoring application;accepting a last data stream record and a total number of streams toretrieve for testing at one time; loading and rendering testingcomponents; storing a last record parameter passed to the streammonitoring application; initializing a heartbeat timer; adding listenersfor a timer event; starting the heartbeat timer to send periodicheartbeat signals on a selected periodic basis; sending the last datastream record with the heartbeat timer to the hosting web page; when notreceiving the heartbeat timer, recognizing an application failure; andrestarting the stream monitoring application by the host web page. 10.The stream monitoring method of claim 9, wherein the initializing aheartbeat timer to produce a periodic heartbeat signal triggersdelivering of the periodic heartbeat signal to an application hostcontainer of the stream monitoring application.
 11. The streammonitoring method of claim 10, wherein the delivering of the periodicheartbeat signal to the application host container indicates that flashvirtual memory (VM) is still running.
 12. The stream monitoring methodof claim 9 further comprises creating a test stream metadata controllerinstance.
 13. The stream monitoring method of claim 9, wherein theadding listeners includes adding for a controller: clear text event,error event, or information events.
 14. The stream monitoring method ofclaim 9, further comprises dispatching a data ready event, indicatingthat it is ready to display data.
 15. The stream monitoring method ofclaim 9, wherein the heartbeat timer is a ping-timer.
 16. The streammonitoring method of claim 9 further comprises listening for a streamevent once for every stream record received.
 17. A stream monitoringmethod, the method comprises: initializing, by a host web page, a streammonitoring application; accepting a last data stream record and a totalnumber of streams to retrieve for testing at one time; loading andrendering testing components; triggering an instantiation of a teststream metadata view; passing the stream monitoring application as aparameter; creating a test stream metadata controller instance to storea reference of the test stream metadata view; registering base viewevent data ready as an event handler; initializing a heartbeat timer;adding listeners for a timer event; starting the heartbeat timer to sendperiodic heartbeat signals on a selected periodic basis; sending thelast stream record with the heartbeat timer to the hosting web page;when not receiving the heartbeat timer, recognizing an applicationfailure; and restarting the stream monitoring application by the hostweb page.
 18. The stream monitoring method of claim 17, wherein theinitializing a heartbeat timer to produce a periodic heartbeat signaltriggers delivering of the periodic heartbeat signal to an applicationhost container of the stream monitoring application.
 19. The streammonitoring method of claim 18, wherein the delivering of the periodicheartbeat signal to the application host container indicates that flashvirtual memory (VM) is still running.
 20. The stream monitoring methodof claim 17 further comprises listening for a stream event once forevery stream record received.